import request from '@/utils/request';

export const getRiskIndexStatistics = () => {
  return request({
    url: '/dp/gis/risk-index/statistics',
    method: 'get'
  });
};

export const getRiskStatus = (type) => {
  return request({
    url: '/criticalAlarmModel/riskStatus',
    method: 'get',
    params: { type }
  });
};

export const getRiskSummary = (type) => {
  return request({
    url: '/criticalAlarmModel/riskSummary',
    method: 'get',
    params: { type }
  });
};

export const getPageAlarmIndicator = (pageNum = 1, pageSize = 4) => {
  return request({
    url: '/criticalAlarmModel/pageAlarmIndicator',
    method: 'get',
    params: { pageNum, pageSize }
  });
};

export const getEquipmentList = () => {
  return request({
    url: '/system/equipment/listAll',
    method: 'get'
  });
};

export const getNodeMap = (equipmentId: number) => {
  return request({
    url: '/criticalAlarmModel/nodeMap',
    method: 'get',
    params: { equipmentId }
  });
};

export const getChainAlarm = (equipmentId?: number, code?: string) => {
  return request({
    url: '/criticalAlarmModel/chainAlarm',
    method: 'get',
    params: { equipmentId, code }
  });
};

// GIS大屏接口
export const getOverallSafetyIndexStatistics = () => {
  return request({
    url: '/dp/gis/overall-safety-index/statistics',
    method: 'get'
  });
};

export const getBusinessIndicatorsStatistics = () => {
  return request({
    url: '/dp/gis/business-indicators/statistics',
    method: 'get'
  });
};

export const getRiskIndicatorLine = () => {
  return request({
    url: '/dp/gis/risk-indicator-line',
    method: 'get'
  });
};

